package com.controller.purchase;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.common.http.HttpResult;
import com.service.purchase.RevealService;

import java.util.HashMap;
import java.util.Map;

/**
 * 揭示管理
 */
@Controller
@RequestMapping(value = "/api")
public class RevealController {

	static final Logger logger = LoggerFactory.getLogger(RevealController.class);
	@Autowired
	RevealService revealService;

	/**
	 * 明细排名
	 * 
	 * @param map
	 * @return
	 */
	@RequestMapping(value = "/purchase/reveal/selectRankMmList", method = { RequestMethod.GET })
	@ResponseBody
	public HttpResult selectRankMmList(@RequestParam String inqId) {
		return revealService.selectRankMmList(inqId);
	}

	/**
	 * 报价揭示
	 * 
	 * @param map
	 * @return
	 */
	@RequestMapping(value = "/purchase/reveal/revealInquiry", method = { RequestMethod.GET })
	@ResponseBody
	public HttpResult revealInquiry(@RequestParam String inqId) {
		return revealService.revealInquiry(inqId);
	}

	/**
	 * 揭示撤回
	 * 
	 * @param inqId
	 * @return
	 */
	@RequestMapping(value = "/purchase/reveal/backReveal", method = { RequestMethod.GET })
	@ResponseBody
	public HttpResult backReveal(@RequestParam String inqId) {
		return revealService.backReveal(inqId);
	}

	/**
	 * 报价揭示
	 * 
	 * @param map
	 * @return
	 */
	@RequestMapping(value = "/purchase/reveal/updateInquiry", method = { RequestMethod.GET })
	@ResponseBody
	public HttpResult updateInquiry(@RequestParam String inqId, @RequestParam String startTime,
			@RequestParam String endTime, @RequestParam String revealTime) {
		return revealService.updateInquiryRevealTime(inqId, startTime, endTime, revealTime);
	}

	/**
	 * 竞价跟进
	 * 
	 * @param map
	 * @return
	 */
	@RequestMapping(value = "/purchase/reveal/updateLowStatus", method = { RequestMethod.GET })
	@ResponseBody
	public HttpResult updateLowStatus(@RequestParam String inqId, @RequestParam String endTime) {
		return revealService.updateLowStatus(inqId, endTime);
	}
}
